package exam;

import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;

public class Main3 {
    public static void main(String[] args) throws IOException {
        Scanner br= new Scanner(new InputStreamReader(System.in));
        String firstLine = br.nextLine();
        int lineNum = Integer.parseInt(firstLine);

        Set<Integer> numSet = new HashSet<>();
        for (int i = 0; i < lineNum; i++) {
            br.nextLine();
            String input = br.nextLine();
            int num = Integer.parseInt(input);
            numSet.add(num);
        }

        List<Integer> rs = new ArrayList<>(numSet);
        rs.sort(new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1 - o2;
            }
        });
        for (Integer num : rs) {
            System.out.println(num);
        }
    }
}
